import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { ArticlesComponent } from './articles/articles.component';
import {ArticleDetailComponent } from './article-detail/article-detail.component';
import {PublishBlogComponent} from "./publish-blog/publish-blog.component";
import {LoginComponent} from "./login/login.component";
import {AuthGuard} from './auth-guard.service';
import {HashLocationStrategy, LocationStrategy} from "@angular/common";
import {ContentTagsComponent} from './content-tags/content-tags.component';
const routes: Routes = [
  {path:'articles',component:ArticlesComponent},
  {path:'login',component:LoginComponent},
  {path:'detail/:id',component:ArticleDetailComponent},
  {path:'publish',component:PublishBlogComponent,canActivate: [AuthGuard]},
  {path:'tags',component:ContentTagsComponent},
  {path:'',redirectTo:'/articles',pathMatch:'full'}
];
@NgModule({
  exports:[ RouterModule ],
  imports:[ RouterModule.forRoot(routes)],
  providers: [{provide: LocationStrategy, useClass: HashLocationStrategy}]
})

export class AppRoutingModule {

}
